/**
AirwayPathfinder for X-Plane Flight Simulator. Calculates the shortest path between two NavAids. 
Copyright (C) 2011  Nils Buletta

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 **/

package de.buletta.airwaypathfinder;

import org.jdesktop.swingx.mapviewer.GeoPosition;

/**
 * Represents a connection via an airway between to navigation points.
 * <p>
 * A {@link Connection} object represents the endpoint of an airway and is to be
 * inserted into an {@link EarthNav} object via the
 * {@link EarthNav#addConnection(Connection c)} method.
 * 
 * @author Nils Buletta
 * @version 0.1
 */
public class Connection {
	private GeoPosition position;
	private String identifier;
	private int layer;

	public Connection() {
	}

	/**
	 * Sets the position of the end point of this connection.
	 * 
	 * @param lat
	 *            - the latitude of this position
	 * @param longi
	 *            - the longitude of this position
	 */
	public void setPosition(double lat, double longi) {
		this.position = new GeoPosition(lat, longi);
	}

	/**
	 * Returns the position of the end point of this connection
	 * 
	 * @return - the position
	 */
	public GeoPosition getPosition() {
		return position;
	}

	/**
	 * Sets the identifier of this connection. The identifier is the name of the
	 * airway.
	 * 
	 * @param i
	 *            - the identifier
	 */
	public void setIdentifier(String i) {
		this.identifier = i;
	}

	/**
	 * Returns the identifier of this connection. The identifier is the name of
	 * the airway.
	 * 
	 * @return - the identifier of this connection
	 */
	public String getIdentifier() {
		return identifier;
	}

	/**
	 * Sets the layer this connection belongs to. 1 for lower layer, 2 for upper
	 * layer, 3 for both layers.
	 * 
	 * @param l
	 *            - the layer this connection belongs to
	 */
	public void setLayer(int l) {
		this.layer = l;
	}

	/**
	 * Returns the layer this connection belongs to.
	 * 
	 * @return - the layer
	 */
	public int getLayer() {
		return layer;
	}
}
